<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
    <title>组织部门</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta name="author" content="飞啊飘啊">
	<meta name="hashcode" content="935587476">
	
	<script>window.duteTag="lz";</script>
	<script type="text/javascript" src="/admin/js/dute-1.0.js"></script>
	<script type="text/javascript" src="/admin/js/jquery-1.7.1.min.js"></script>
	
	<script type="text/javascript" src="/admin/js/lazy3q.ui.js"></script>
	<script>
		document.write('<link rel="stylesheet" type="text/css" href="/admin//css/'+($.cookie('theme')||'elegant')+'/lazy3q.ui.css" /> ');
	</script>
	
	<script type="text/javascript" src="/admin/js/jquery-ui-1.10.2.custom.min.js"></script>
	
	<!-- 用户自定义js(懒加载) -->
	<script type="text/javascript" src="/admin/js/define.js"></script>
	<!-- 用户自定义css样式 -->
	<link rel="stylesheet" type="text/css" href="/admin/css/define.css"/>
	<!-- icon font -->
  	<link rel="stylesheet" href="/admin/css/iconfont.css">
	
	
	
	<script type="text/javascript">
		window.basePath="/";
		window.hashcode = "935587476";
	</script>
		
	<!-- 感谢kindeditor出品的在线HTML编辑控件 -->
	<script type="text/javascript" charset="utf-8" src="/admin/js/kindeditor/kindeditor.js"></script>
		
	<!-- 感谢My97DatePicker出品的时间控件 -->
	<script language="javascript" type="text/javascript" src="/admin/js/My97DatePicker/WdatePicker.js"></script>
	
	<!------------------------VIEW_HTML_HEAD------------------------>
	<!------------------------VIEW_HTML_HEAD------------------------>	
	
</head>
<script>
Page({
  data:{
    
  },
  onLoad: function(options) {
  	var THIS = this;
  	THIS.setData(options);
  	$.getAjax("group.get.do",options,function(protocol){
  		if(protocol.message){
  			$.toast(protocol.message);
  		}
  		document.title={
  			 "insert":"创建组织部门"
  			,"inport":"导入组织部门"
  			,"update":"修改组织部门"
  			,"detail":"组织部门详情"
  		}[options.edittype];
  		THIS.setData(protocol.data); 
  		/******************VIEW_HTML_SET_DATA******************/
  		/******************VIEW_HTML_SET_DATA******************/
  	});
  }
});
</script>
<script>
window["lzFlashUrl"]=top.lzFlashUrl||"/admin/flash/";
window["uploadUrl"]=top.uploadUrl||"/admin/upload.do";

$(function(){
		 
	$("#groupForm").form({
		"":function(){}
		,"srvGroup.sgId":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvGroup.sgName":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "组名称不能为空";
			}
		}
		,"srvGroup.sgParent":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvGroup.sgFamily":function(el){
		}
		,"srvGroup.sgUser":function(el){
			if(jQuery.trim(el.value)!=""){
				var protocol = $.getAjax("group.query.do",{exists:true,sgUser:el.value});
				if(protocol.success && protocol.data.list && protocol.data.list.length>0){
					if(!$("#sgId").val() || protocol.data.list[0].key!=$("#sgId").val())
						return "负责人已存在";						
				}
			}
		}
		,"srvGroup.sgFlag":function(el){
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "组标识最大长度为32个字符";
		}
		,"srvGroup.sgStatus":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "请选择状态";
			}
		}
	},function(){
		/******************************LAZY3Q_FORM_VALIDATE******************************/
		/******************************LAZY3Q_FORM_VALIDATE******************************/
	});		
});
</script>

<body style="display:none;">



<!------------------------VIEW_HTML_TOP------------------------>
<!------------------------VIEW_HTML_TOP------------------------>


<form enctype="{{inports!=null?'multipart/form-data':''}}" lz:if="{{edittype=='insert'||edittype=='update'||edittype=='detail'||edittype=='any'||edittype=='inport'}}" class="form editform edittype_{{edittype}}" ref="SrvGroup" id="groupForm" name="groupForm" target="jsoniframe" action="group.{{edittype=='any'?'update':edittype}}.do" method="post">
	<div class="head"></div>
	<div class="body">
		<div class="content">
			<div lz:if="{{edittype!='detail'}}" class="prompt">
				温馨提示：请仔细填写组织部门相关信息，<span class="extrude">"*" 为必填选项。</span>
			</div>
			<br/>
			<lz:block lz:if="{{message}}">
			<br/>
			<center>
				<font color="red"><h4>{{message}}</h4></font>
			</center>
			<br/>
			</lz:block>
			<input type="hidden" value="{{complete}}" name="complete" id="complete" />
			<input type="hidden" value="{{ids}}" name="ids" id="ids" />
			<textarea name="PARAMS" id="PARAMS" style="display:none">{{PARAMS}}</textarea>
			
			
			<lz:block lz:if="{{inports}}">
			  <div class="line"></div>
			  <dl style="width:98%;">
			  	<dt>Excel文件:</dt>
			  	<dd>
			  		<input type="hidden" value="{{inports}}" name="inports" id="inports" />
			  		<input type="hidden" value="{{inport$}}" name="inport$" id="inport$" />
			  		<input name="file" name="file" type="file"/>
			  		<b>*</b>
			  		<div>
						请上传excel文件，表格列依次为：[{{inport$}}]，excel表格第一行为列名称，将不作为上传数据行
					</div>
			  	</dd>
			  </dl>
			  <div class="line"></div>
			</lz:block>
	{{lz.set("sgId_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"sgId"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"sgId"))))}}
	{{lz.set("sgId_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$sgId}}
	<dl lz:if="{{sgId_editable||sgId_readonly}}" class="sgId hidden " major  ref="sgId">
		<dt>编　　号:</dt>
		<dd lz:if="{{sgId_editable}}" input="hidden">
			<lz:block lz:if="{{srvGroup$sgId}}">
				{{srvGroup$sgId}}
			</lz:block>
			<lz:block lz:if="{{!srvGroup$sgId}}">
			<input type="hidden" value="{{lz.htm(srvGroup.sgId)}}" name="srvGroup.sgId" id="sgId" />
	 	 </lz:block>
	 	 
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{sgId_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="sgId">{{srvGroup.sgId}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvGroup.sgId$||srvGroup.sgId)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$sgId}}
	{{lz.set("sgName_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"sgName"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"sgName"))))}}
	{{lz.set("sgName_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$sgName}}
	<dl lz:if="{{sgName_editable||sgName_readonly}}" class="sgName  " major  ref="sgName">
		<dt>组 名 称:</dt>
		<dd lz:if="{{sgName_editable}}" input="text">
			<lz:block lz:if="{{srvGroup$sgName}}">
				{{srvGroup$sgName}}
			</lz:block>
			<lz:block lz:if="{{!srvGroup$sgName}}">
		 	<input type="text" class="input narrow"   name="srvGroup.sgName" id="sgName"  value="{{lz.htm(srvGroup.sgName)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入组织部门的组名称</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{sgName_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="sgName">{{srvGroup.sgName}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvGroup.sgName$||srvGroup.sgName)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$sgName}}
	{{lz.set("sgParent_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"sgParent"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"sgParent"))))}}
	{{lz.set("sgParent_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$sgParent}}
	<dl lz:if="{{sgParent_editable||sgParent_readonly}}" class="sgParent  " major  ref="sgParent">
		<dt>上 级 组:</dt>
		<dd lz:if="{{sgParent_editable}}" input="tree">
			<lz:block lz:if="{{srvGroup$sgParent}}">
				{{srvGroup$sgParent}}
			</lz:block>
			<lz:block lz:if="{{!srvGroup$sgParent}}">
		  			<select class="tree narrow"  id="sgParent" name="srvGroup.sgParent" action="/admin/permissions/group.query.do?parenter={param}&not={{srvGroup.sgId}}">
						<option value="{{lz.htm(srvGroup.sgParent)}}">{{srvGroup.sgParent$||srvGroup.sgParent}}</option>
					</select>			  		
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择组织部门的上级组</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{sgParent_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class="" name="srvGroup.sgParent" style="display:none;" id="sgParent">{{srvGroup.sgParent}}</textarea>
		 		<span>
		 	
			 <a href="javascript:void(0);" onclick="window.href('/admin/permissions/group.details.html?key=srvGroup.sgParent}')">
			 {{lz.html(srvGroup.sgParent$||srvGroup.sgParent)}}</a>
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$sgParent}}
	{{lz.set("sgFamily_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"sgFamily"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"sgFamily"))))}}
	{{lz.set("sgFamily_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$sgFamily}}
	<dl lz:if="{{sgFamily_editable||sgFamily_readonly}}" class="sgFamily hidden " minor  ref="sgFamily">
		<dt>族 序 列:</dt>
		<dd lz:if="{{sgFamily_editable}}" input="hidden">
			<lz:block lz:if="{{srvGroup$sgFamily}}">
				{{srvGroup$sgFamily}}
			</lz:block>
			<lz:block lz:if="{{!srvGroup$sgFamily}}">
			<input type="hidden" value="{{lz.htm(srvGroup.sgFamily)}}" name="srvGroup.sgFamily" id="sgFamily" />
	 	 </lz:block>
	 	 
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{sgFamily_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="sgFamily">{{srvGroup.sgFamily}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvGroup.sgFamily$||srvGroup.sgFamily)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$sgFamily}}
	{{lz.set("sgUser_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"sgUser"))))&&false)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"sgUser"))))}}
	{{lz.set("sgUser_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$sgUser}}
	<dl lz:if="{{sgUser_editable||sgUser_readonly}}" class="sgUser  " major  ref="sgUser">
		<dt>负 责 人:</dt>
		<dd lz:if="{{sgUser_editable}}" input="combox">
			<lz:block lz:if="{{srvGroup$sgUser}}">
				{{srvGroup$sgUser}}
			</lz:block>
			<lz:block lz:if="{{!srvGroup$sgUser}}">
		 			<select class="combox narrow" action="/admin/permissions/user.query.do?size=255&suGroup={sgId}" id="sgUser" name="srvGroup.sgUser">
		 				<option selected="selected" value="{{lz.htm(srvGroup.sgUser)}}">{{lz.htm(srvGroup.sgUser$||srvGroup.sgUser)}}</option>
		 			</select>
		 			<a class="lookup" href="javascript:void(0);" onclick="if($.trim($('#sgUser').val())==''){return;};window.href('/admin/permissions/user.detail.do?key='+$('#sgUser').val(),{ctrl:{editable:false}})"></a>
	 	 </lz:block>
	 	 
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{sgUser_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="sgUser">{{srvGroup.sgUser}}</textarea>
		 		<span>
		 	
			 <a href="javascript:void(0);" onclick="window.href('/admin/permissions/user.details.html?key=srvGroup.sgUser}')">
			 {{lz.html(srvGroup.sgUser$||srvGroup.sgUser)}}</a>
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$sgUser}}
	{{lz.set("sgFlag_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"sgFlag"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"sgFlag"))))}}
	{{lz.set("sgFlag_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$sgFlag}}
	<dl lz:if="{{sgFlag_editable||sgFlag_readonly}}" class="ribs sgFlag  " major  ref="sgFlag">
		<dt>组 标 识:</dt>
		<dd lz:if="{{sgFlag_editable}}" input="text">
			<lz:block lz:if="{{srvGroup$sgFlag}}">
				{{srvGroup$sgFlag}}
			</lz:block>
			<lz:block lz:if="{{!srvGroup$sgFlag}}">
		 	<input type="text" class="input narrow"  maxlength="32" name="srvGroup.sgFlag" id="sgFlag"  value="{{lz.htm(srvGroup.sgFlag)}}"/>
	 	 </lz:block>
	 	 
	 	 <em>请输入组织部门的组标识</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{sgFlag_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="sgFlag">{{srvGroup.sgFlag}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvGroup.sgFlag$||srvGroup.sgFlag)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$sgFlag}}
	{{lz.set("sgStatus_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"sgStatus"))))&&false)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"sgStatus"))))}}
	{{lz.set("sgStatus_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$sgStatus}}
	<dl lz:if="{{sgStatus_editable||sgStatus_readonly}}" class="sgStatus  " major  ref="sgStatus">
		<dt>状　　态:</dt>
		<dd lz:if="{{sgStatus_editable}}" input="select">
			<lz:block lz:if="{{srvGroup$sgStatus}}">
				{{srvGroup$sgStatus}}
			</lz:block>
			<lz:block lz:if="{{!srvGroup$sgStatus}}">
		 	<select class="narrow" id="sgStatus" name="srvGroup.sgStatus">
		 		<option value="">请选择</option>
				<option value="1" selected='{{srvGroup.sgStatus=="1"?"selected":""}}'>启用</option>
				<option value="0" selected='{{srvGroup.sgStatus=="0"?"selected":""}}'>禁用</option>
		 	</select>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择组织部门的状态</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{sgStatus_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="sgStatus">{{srvGroup.sgStatus}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvGroup.sgStatus$||srvGroup.sgStatus)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$sgStatus}}
			
			
			<div class="line">
				<center lz:if="{{edittype=='insert'}}">
					<a onclick="$('.ribs').show();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:inline;padding: 0px 15px;">点击展开更多编辑项</a>
					<a onclick="$('.ribs').hide();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:none;padding: 0px 15px;">点击收起更多编辑项</a>
				</center>
			</div>
			<center class="buttons">
				<input type="hidden" value="{{srvGroup.sgId}}" name="srvGroup.sgId" id="sgId" />
			
			<lz:block lz:if="{{edittype=='insert'||edittype=='update'||edittype=='any'||edittype=='inport'}}">
				<button class="button" type="submit">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					保存&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
			
			<lz:block lz:if="{{edittype=='detail'}}">
				<button lz:if="{{canEdit}}" type="button" class="button" onclick='window.location.href="/admin/permissions/group.edit.html?edittype=update&id={{srvGroup.id}}"'>
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					修改&nbsp;&nbsp;</button>
				<button lz:if="{{canDel}}" type="button" class="button" onclick="deleteGroup('{{srvGroup.id}}','{{srvGroup.sgName}}')">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					删除&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
					
			</center>
			<br/>

		</div>
	</div>
	<div class="foot"></div>		
</form>

 


<!------------------------VIEW_HTML_BOTTOM------------------------>
<!------------------------VIEW_HTML_BOTTOM------------------------>


</body>

<!------------------------VIEW_HTML_FOOTER------------------------>
<!------------------------VIEW_HTML_FOOTER------------------------>
<script>
	
	$(function(){
		if(parent.setit){
			parent.setit("/admin/permissions/group.edit.html",document.title,"/admin//images/icons/2008112220121595877809.png");
		}
	});
	
	function cancel(){
		if(parent.closeHref){
			parent.closeHref("/admin/permissions/group.edit.html");
		}else{
			$.closeModalDialog();
		}
	}


	/**
	* 删除组织部门
	**/
	function deleteGroup(id,flag)
	{
		var dialog=top.$.dialog({
				html:"<span style='white-space:nowrap;'>确定要删除当前数据吗？</span>",
				title:"删除组织部门",
				modal: true,			
				onOk:function(){
					dialog.closeDialog();
					var url = "/admin/permissions/group.delete.do";
					var params = {id:id};
					var protocol = $.getAjax(url,params);
					if(protocol.message){
						top.$.toast(protocol.message);
					}
					if(protocol.success){
						caller.location.href=caller.location.href;		
					}
				}
		 });	
	}
</script>
</html>